package com.zhuojy.equity.mall.admin.web.controller.car;

import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarCheerPO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarCheerService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/6 19:23
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("carcheer")
public class TCarCheerController {
    @Autowired
    private TCarCheerService tCarCheerService;

    /**
     * 添加加油记录
     * @param tCarCheerPO
     * @return
     */
    @RequestMapping("addCarcheer")
    private ResultEntity addCarcheer(@RequestBody TCarCheerPO tCarCheerPO){
        return tCarCheerService.addCarcheer(tCarCheerPO);
    }

    /**
     * 查询加油信息的列表信息
     * @param tCarCheerPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findCarcheer")
    private ResultEntity findCarcheer(@RequestBody TCarCheerPO tCarCheerPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum")Integer pageNum){
        return tCarCheerService.findCarcheer(tCarCheerPO,pageSize,pageNum);
    }

    /**
     * 查询指定的加油信息
     * @param id
     * @return
     */
    @RequestMapping("echoCarcheer")
    private ResultEntity echoCarcheer(@RequestParam("id")Integer id){
        return tCarCheerService.echoCarcheer(id);
    }

    /**
     * 删除指定的加油信息
     * @param id
     * @return
     */
    @RequestMapping("delCarcheer")
    private ResultEntity delCarcheer(@RequestParam("id")Integer id){
        return tCarCheerService.delCarcheer(id);
    }

    /**
     * 修改指定信息
     * @param tCarCheerPO
     * @return
     */
    @RequestMapping("updatelCarcheer")
    private ResultEntity updatelCarcheer(@RequestBody TCarCheerPO tCarCheerPO){
        return tCarCheerService.updatelCarcheer(tCarCheerPO);
    }
}
